package love.lkzy.oj.codeSandBox.controller;


import love.lkzy.oj.codeSandBox.ICodeSandBox;
import love.lkzy.oj.codeSandBox.model.ExecuteCodeRequest;
import love.lkzy.oj.codeSandBox.model.ExecuteCodeResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Scanner;

@RestController
public class TestController {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        scanner.next();
        int res = Integer.parseInt(args[0]) + Integer.parseInt(args[1]);
        System.out.println(res);
    }


    @Resource
    private ICodeSandBox sandBox;

    @PostMapping("/test")
    public ExecuteCodeResponse test(@RequestBody ExecuteCodeRequest request){
        return sandBox.executeCode(request);
    }
}
